import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Text3 {
    public static void main(String[] args) {
        /*
        班级有五个学生,被点到的学生不会再被点到,如果学生点完了,则需要第二轮点名
        */
        ArrayList<String> list1=new ArrayList<>();
        ArrayList<String> list2=new ArrayList<>();
        Collections.addAll(list1,"杨坤伦","张佳迪","张天宇","潭淏","付林立");
        Random r=new Random();
        int count=list1.size();
        for(int j=1;j<10;j++) {
            System.out.println("===========第"+j+"轮===================");
            for (int i = 0; i < count; i++) {
                int index = r.nextInt(list1.size());
                String name = list1.remove(index);
                Collections.addAll(list2, name);
                System.out.println(name);
            }
            //批量添加
            list1.addAll(list2);
            list2.clear();
        }
    }
}
